package com.tiwi.gmbdr.tools;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;

public class DialogManager {

	private static final String POSITIVE_BUTTON = "Yes";
	private static final String NEGATIVE_BUTTON = "No";

	public static void showExitAlert(final Activity activity, String message,
			boolean cancelable) {

		final AlertDialog.Builder builder = new AlertDialog.Builder(activity);
		builder.setMessage(message);
		builder.setCancelable(cancelable);
		builder.setPositiveButton(POSITIVE_BUTTON,
				new DialogInterface.OnClickListener() {
					public void onClick(DialogInterface dialog, int id) {

						activity.finish();
					}
				});
		builder.setNegativeButton(NEGATIVE_BUTTON,
				new DialogInterface.OnClickListener() {
					public void onClick(DialogInterface dialog, int id) {
						dialog.cancel();
					}
				});
		builder.create().show();
	}

}
